<template>
	<button class="md-button" :loading="props.loading" :style="{ background: color ? color : '#d92121', color: textColor ? textColor : 'white' }" @click="handleClick" :open-type="openType">
		<text v-if="props.title">{{ props.title }}</text>
		<slot></slot>
	</button>
</template>
<script setup lang="ts">
const emit = defineEmits(['click']);
// 接收props
let props = defineProps<{
	title?: String;
	loading: Boolean;
	color?: string;
	textColor?: string;
	// 临时加的功能，后面考虑调整
	openType?: string;
}>();

const handleClick = () => {
	emit('click')
};
</script>
<style lang="scss" scoped>
.md-button {
	height: 88rpx;
	border-radius: 20rpx;
	color: $white;
	font-size: 34rpx;
}
</style>
